<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>
        <p:dialog id="WebEditDlg" widgetVar="WebEditDialog" modal="true" resizable="false"  appendTo="@(body)" header="#{seriesBundle.EditWebTitle}" closeOnEscape="true">

            <h:form id="WebEditForm">

                <h:panelGroup id="display">
                    <p:panelGrid  columns="2" columnClasses="column" rendered="#{webController.selected != null}">


                        <h:outputLabel value="#{seriesBundle.EditWebLabel_idWeb}" for="idWeb" />
                        <h:panelGroup>
                            <h:outputText id="idWeb" value="#{webController.selected.idWeb}" />
                            <p:tooltip for="idWeb" value="#{webController.getComponentMessages('idWeb', seriesBundle.EditWebHelpText_idWeb)}"/>
                        </h:panelGroup>

                        <p:outputLabel value="#{seriesBundle.EditWebLabel_titulo}" for="titulo" />
                        <h:panelGroup>
                            <p:inputText id="titulo" value="#{webController.selected.titulo}" title="#{seriesBundle.EditWebTitle_titulo}" size="50" maxlength="50"/>
                            <p:tooltip for="titulo" value="#{webController.getComponentMessages('titulo', seriesBundle.EditWebHelpText_titulo)}"/>
                        </h:panelGroup>

                        <p:outputLabel value="#{seriesBundle.EditWebLabel_siglas}" for="siglas" />
                        <h:panelGroup>
                            <p:inputText id="siglas" value="#{webController.selected.siglas}" title="#{seriesBundle.EditWebTitle_siglas}" size="20" maxlength="20"/>
                            <p:tooltip for="siglas" value="#{webController.getComponentMessages('siglas', seriesBundle.EditWebHelpText_siglas)}"/>
                        </h:panelGroup>

                        <p:outputLabel value="#{seriesBundle.EditWebLabel_facebook}" for="facebook" />
                        <h:panelGroup>
                            <p:inputText id="facebook" value="#{webController.selected.facebook}" title="#{seriesBundle.EditWebTitle_facebook}" size="100" maxlength="100"/>
                            <p:tooltip for="facebook" value="#{webController.getComponentMessages('facebook', seriesBundle.EditWebHelpText_facebook)}"/>
                        </h:panelGroup>

                        <p:outputLabel value="#{seriesBundle.EditWebLabel_pagina}" for="pagina" />
                        <h:panelGroup>
                            <p:inputText id="pagina" value="#{webController.selected.pagina}" title="#{seriesBundle.EditWebTitle_pagina}" size="50" maxlength="50"/>
                            <p:tooltip for="pagina" value="#{webController.getComponentMessages('pagina', seriesBundle.EditWebHelpText_pagina)}"/>
                        </h:panelGroup>

                        <p:outputLabel value="#{seriesBundle.EditWebLabel_descripcion}" for="descripcion" />
                        <h:panelGroup>
                            <p:inputText id="descripcion" value="#{webController.selected.descripcion}" title="#{seriesBundle.EditWebTitle_descripcion}" size="100" maxlength="100"/>
                            <p:tooltip for="descripcion" value="#{webController.getComponentMessages('descripcion', seriesBundle.EditWebHelpText_descripcion)}"/>
                        </h:panelGroup>

                        <p:outputLabel value="#{seriesBundle.EditWebLabel_idRango}" for="idRango" />
                        <h:panelGroup>
                            <p:selectOneMenu id="idRango" value="#{webController.selected.idRango}" required="true" requiredMessage="#{seriesBundle.EditWebRequiredMessage_idRango}" converter="xRangoConverter">
                                <f:selectItem itemLabel="#{seriesBundle.SelectOneMessage}"/>
                                <f:selectItems value="#{xRangoController.items}"
                                               var="idRangoItem"
                                               itemValue="#{idRangoItem}"
                                               itemLabel="#{idRangoItem.descripcion.toString()}"
                                               />

                            </p:selectOneMenu>
                            <p:tooltip for="idRango" value="#{webController.getComponentMessages('idRango', seriesBundle.EditWebHelpText_idRango)}"/>
                        </h:panelGroup>

                        <p:outputLabel value="#{seriesBundle.EditWebLabel_idImagen}" for="idImagen" />
                        <h:panelGroup>
                            <p:selectOneMenu id="idImagen" value="#{webController.selected.idImagen}"  converter="xImagenConverter">
                                <f:selectItem itemLabel="#{seriesBundle.SelectOneMessage}"/>
                                <f:selectItems value="#{xImagenController.items}"
                                               var="idImagenItem"
                                               itemValue="#{idImagenItem}"
                                               itemLabel="#{idImagenItem.descripcion.toString()}"
                                               />

                            </p:selectOneMenu>
                            <p:tooltip for="idImagen" value="#{webController.getComponentMessages('idImagen', seriesBundle.EditWebHelpText_idImagen)}"/>
                        </h:panelGroup>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{webController.save}" value="#{seriesBundle.Save}" update="display,:WebListForm:datalist,:growl" oncomplete="handleSubmit(xhr,status,args,PF('WebEditDialog'));">
                        <p:confirm header="#{seriesBundle.ConfirmationHeader}" message="#{seriesBundle.ConfirmEditMessage}" icon="ui-icon-alert"/>
                    </p:commandButton>
                    <p:commandButton value="#{seriesBundle.Cancel}" onclick="PF('WebEditDialog').hide()"/>
                </h:panelGroup>

            </h:form>

        </p:dialog>

    </ui:composition>

</html>
